<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>银行管理</title>
    <%@ include file="/WEB-INF/view/common/includ-css.jsp" %>
</head>
<body class="gray-bg">
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2>银行管理</h2>
    </div>
</div>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>基本 <small>分类，查找</small></h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="table_data_tables.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li><a href="table_data_tables.html#">选项1</a>
                            </li>
                            <li><a href="table_data_tables.html#">选项2</a>
                            </li>
                        </ul>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <table id="dataTables" class="table table-striped table-bordered table-hover">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>名称</th>
                            <th>图片</th>
                            <th>备注</th>
                            <th>贷记卡</th>
                            <th>借记卡</th>
                            <th>状态</th>
                        </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<%@ include file="/WEB-INF/view/common/includ-js.jsp" %>
<!-- Data Tables -->
<script src="${path}/static/Hui/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${path}/static/Hui/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="${path}/static/plugins/layui/layui.all.js"></script>
<script>
    $(function(){

        // 关闭错误提示
        $.fn.dataTable.ext.errMode = 'none';

        // 数据表格
        $("#dataTables").dataTable({
            serverSide: true,
            searching: false,
            ordering:  false,
            lengthChange: false,
            processing: false,
            pageLength: 20,
            "ajax":{
                url:"/bank/list",
                type:"post"
            },
            columns: [
                { "data": "id" },
                { "data": "bank_name" },
                { "data": "bank_url_img" },
                { "data": "remark" },
                { "data": "supportCreditCard" },
                { "data": "supportDebitCard" },
                { "data": "status" }
            ],
            columnDefs: [
                {
                    "render": function(data, type, row, meta) {
                        var html ='暂无图片';
                        if(data!=null && data!=''){
                            html = '<img src="'+data+'" style="height: 40px;"/>';
                        }
                        return html;
                    },
                    "targets": 2
                },
                {
                    "render": function(data, type, row, meta) {
                        var html = '暂无数据';
                        if(data!=null && data!=''){
                            html = data;
                        }
                        return html;
                    },
                    "targets": 3
                },
                {
                    "render": function(data, type, row, meta) {
                        var html ='不支持';
                        if(data=='Y'){
                            html = '支持';
                        }
                        return html;
                    },
                    "targets": 4
                },
                {
                    "render": function(data, type, row, meta) {
                        var html ='不支持';
                        if(data=='Y'){
                            html = '支持';
                        }
                        return html;
                    },
                    "targets": 5
                },
                {
                    "render": function(data, type, row, meta) {
                        var html ='正常';
                        if(data==2){
                            html = '禁用';
                        }
                        return html;
                    },
                    "targets": 6
                }
            ]
        });
    });
</script>
</body>
</html>
